﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NGinnBPM.MessageBus.Impl;

namespace NGinnBPM.Services.Util
{
    public class StartableDelegate : IStartableService
    {
        private Action _start, _stop;

        public StartableDelegate(Action start, Action stop)
        {
            _start = start;
            _stop = stop;
        }

        public bool IsRunning
        {
            get { return true; }
        }

        public void Start()
        {
            if (_start != null) _start();
        }

        public void Stop()
        {
            if (_stop != null) _stop();
        }
    }
}
